Tuya - Air Condioner support - PR9#2458
Tuya - Air Condioner support - PR9#2458Terdious wants to merge 96 commits intoGladysAssistant:masterfrom
Conversation
…er models - Added support for air conditioning devices with new mappings and DPS configurations. - Introduced local polling for Tuya devices to improve responsiveness. - Enhanced device conversion logic to include additional parameters such as cloud IP and local override. - Updated feature conversion to utilize advanced DPS mappings for air conditioning. - Implemented new models for air conditioning and power meter, including specific feature mappings. - Improved error handling and logging for local polling and device value setting. - Added unit tests for new feature mappings and conversion logic.
…y device conversion logic
…ttre à jour les tests associés
… champ d'erreur dans le payload de l'événement WebSocket
…s et ajouter des tests pour la gestion des appareils locaux
…on Tuya dans les fichiers de langue
…ion Tuya et mettre à jour les traductions
… des appareils Tuya
…tre l'utilisation d'adresses spécifiques
…eurs de port et mise à jour des traductions
…re des liens vers la documentation et les options de connexion
…réation de rapports GitHub pour les appareils Tuya
…l disconnect features - Added new translations for connection status messages in German, English, and French. - Implemented API endpoints to get Tuya connection status and to manually disconnect from the Tuya cloud. - Updated the Tuya service to handle automatic reconnection logic and manual disconnect state. - Enhanced the SetupTab component to reflect connection status and provide a disconnect button. - Added tests for the new functionality, including status retrieval and manual disconnect.
- Implemented device ranking and sorting in DiscoverTab for better user experience. - Added loading indicators and improved UI feedback during device scanning. - Refactored local polling logic to update discovered devices with local information. - Introduced utility functions for managing device parameters, including upserting and normalizing values. - Enhanced local scan response handling to merge existing device parameters. - Updated tests to cover new functionality and ensure reliability of device management.
…ls et des tests associés
… débogage pour la gestion des appareils
…age, ajouter des tests pour la reconnexion automatique et la découverte des appareils
… des paramètres dans le code de configuration Tuya
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds comprehensive Tuya integration: local UDP scanning and local device polling, expanded air-conditioning feature mappings and UI components (fan speed, modes), auto-reconnect and manual-disconnect logic, new Tuya service endpoints and manager methods, richer device conversion/mapping, and extensive tests and i18n updates. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as Client UI
participant API as Gladys API
participant Manager as TuyaHandler
participant Device as Local Tuya Device
participant GitHub as GitHub
UI->>API: POST /api/v1/service/tuya/local-scan
API->>Manager: localScan()
Manager->>Device: open UDP sockets, listen
Device-->>Manager: UDP broadcast (device info)
Manager->>Manager: buildLocalScanResponse (merge with discoveredDevices)
Manager-->>API: scan response
API-->>UI: scan response
UI->>API: POST /api/v1/service/tuya/local-poll {deviceId}
API->>Manager: localPoll(payload)
Manager->>Device: connect (tuyapi / newgen) and request DPS
Device-->>Manager: DPS payload
Manager->>Manager: updateDiscoveredDeviceAfterLocalPoll()
Manager-->>API: poll result
API-->>UI: poll result
UI->>API: Create GitHub issue (partial support)
API->>Manager: build/create issue payload
Manager->>GitHub: query/create issue
GitHub-->>Manager: issue result
Manager-->>API: issue status
API-->>UI: issue status
Estimated code review effort🎯 4 (Complex) | ⏱️ ~70 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
#3981 Bundle Size — 11.53MiB (+1.18%).a3ae938(current) vs 8db6b0d master#3902(baseline) Warning Bundle contains 2 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
Bundle analysis report Branch Terdious:tuya-air-conditioner-su... Project dashboard Generated by RelativeCI Documentation Report issue |
ed38a86 to
a66f773
Compare
Pull Request check-list
To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:
npm teston both front/server)npm run eslinton both front/server)npm run prettieron both front/server)npm run compare-translationson front)front/src/config/demo.js) so that the demo website is working without a backend? (if needed) See https://demo.gladysassistant.com.NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
Description of change
Summary
#2479.switchtemp_settemp_currentmodefan_speed_enumhorizontalverticalDetails
air-conditionerTuya device typetuya.cloudStrategyby removing unreachable/dead branches while preserving behaviorair-conditioner-f3goccgfj6qino4cAIR_CONDITIONING.BINARY)Why this matters
Scope
Compared to
tuya-pilot-thermostat-support:Front (prod)
+147 lines / -45 linesTranslations
+93 lines / -6 linesServer (prod)
+311 lines / -11 linesServer Tests
+778 lines / -0 linesNo package changes.
Total
27 files changed+1329 lines / -62 linesSummary by CodeRabbit
New Features
Improvements